package joctave.ui.awt;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

import joctave.core.interpreter.ErrorLogger;

/**Simple dialog extension that creates a new non-modal and centered dialog.*/
public class ConfigGUIDialog extends GUIDialog implements ActionListener
{

	Checkbox debugCheckbox;

	public ConfigGUIDialog(Frame _owner)
	{
		super(_owner, "Configuration");
		setVisible(false);
		setSize(250, 200);
		setResizable(false);
		// Let's initialize the labels
		/*Label skinhatLabel = new Label("Debug");
		skinhatLabel.setLocation(getInsets().left+40, getInsets().top+30);
		skinhatLabel.setSize(100, 21);
		skinhatLabel.setFont(new Font("Dialog", Font.BOLD, 12));
		add(skinhatLabel);*/

		debugCheckbox = new Checkbox("Debug", true);
		debugCheckbox.setState(ErrorLogger.getDebug());
	    debugCheckbox.setBounds(getInsets().left+30, getInsets().top+55,
							   150, 21);		
		add(debugCheckbox);
	
		Button okButton = new Button("Ok");
		okButton.setBounds(getInsets().left+30, getInsets().top+105,
				   100, 21);
		okButton.addActionListener(this);		
		add(okButton);

		setVisible(true);
	}
	
	public void actionPerformed(ActionEvent e)
	{
		setVisible(false);
		//Object o = e.getSource();
		
		/*if (o == acceptButton) {
			// Let's check all the checkboxes
			this.dispose();
		} else if (o == defaultButton) {
		} else if (o == saveButton) {
		}*/
	}	
}
